extends "../cTDZ/cTDZ.gd"
func _info():
	pass

func _connect():
	._connect()

func _extInit():
	._extInit()
	chaName = "骷髅兵"
	camp = "骷髅"
	lv = 1
	attCoe.atkRan = 1
	attCoe.atk = 15 / 8.5 * 2
	attCoe.maxHp = 480 / 112.5
	attAdd.spd += 0.5
	atkEff = "atk_dao"
	skillStrs = []
	evos =["cTD2_1"]
	aiOn = true
	addSkillTxt("骨骼灵魂：死亡后立刻以33%血量复活[受禁止复活影响][cd:30秒]<固化>|开局消耗自身4%血量为全体队员附加33点物防[无法叠加效果]")

var recnt = 0
var flag = 1
func _onBattleStart():
	._onBattleStart()
	recnt = 0
	flag = 1
	self.plusHp(-att.maxHp * 0.04)
	var chas = getAllChas(2)
	for i in chas:
		i.addBuff(GGFY.new(1))

func _onDeath(atkinfo):
	if !self.isDeath:return
	if !self.canre:return
	if flag:
		self.isDeath = false
		#print(att.hp)
		#print(att.maxHp)
		#plusHp(att.maxHp * 0.5)
		#print(att.hp)
		cst("灵魂难灭","000000",position)
		atkinfo.hurtVal = 0
		var tmp = attInfo.reHp
		attInfo.reHp = 0
		upAtt()
		plusHp(att.maxHp * 0.33) 
		attInfo.reHp = tmp
		upAtt()
		flag = 0
		#print("技能")
	._onDeath(atkinfo)


func _upS():
	._upS()
	if !flag:
		recnt += 1
		if recnt % 30 == 0:
			flag = 1
			recnt = 0 

class GGFY:
	extends Buff
	var canremove:bool = false
	func _init(lv):
		attInit()
		life = 100000 * lv
		id = "GGFY"
		att.def = 33